<template>
	<view class="p50">
		<u-form labelWidth="auto" :borderBottom="false">
			<u-form-item>
				<view class="p10 pl30 pr30 w-max bg-f8f radius20">
					<u-input v-model="form.mobile" maxlength="11" placeholder="请输入你的手机号"></u-input>
				</view>
			</u-form-item>
			<u-form-item>
				<view class="p10 pl30 pr30 w-max bg-f8f radius20 flex">
					<u-input v-model="form.code" maxlength="11" placeholder="请输入验证码"></u-input>
					<tips :mobile="form.mobile" type="forget_trade"></tips>
				</view>
			</u-form-item>
			<u-form-item>
				<view class="p10 pl30 pr30 w-max bg-f8f radius20 flex row-between">
					<u-input v-model="form.trade_pwd" class="flex1" placeholder="请输入新密码"></u-input>
				</view>
			</u-form-item>
			<u-form-item>
				<view class="p10 pl30 pr30 w-max bg-f8f radius20 flex row-between">
					<u-input v-model="form.trade_pwd2" class="flex1" placeholder="确认新密码"></u-input>
				</view>
			</u-form-item>
		</u-form>
		<view class="h40"></view>
		<u-button type="warning" @click="submit">确定</u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					mobile: '',
					code: '',
					trade_pwd: '',
					trade_pwd2: ''
				},
			};
		},
		onLoad(e) {
			this.form.oldcode = e.code
		},
		methods: {
			submit() {
				this.$request('/member/personal/forgetTradePwd', this.form).then(res => {
					this.$msg(res.msg)
					this.$getUser()
					this.$navBack(1, 1000)
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF;
	}
</style>
